# coding: utf-8
from sqlalchemy import BigInteger, Column, DateTime, Integer, String
from sqlalchemy.schema import FetchedValue
from flask_sqlalchemy import SQLAlchemy


from application import db

class DeviceRelation(db.Model):
    __tablename__ = 'device_relation'

    id = db.Column(db.BigInteger, primary_key=True)
    check_id = db.Column(db.BigInteger, nullable=False)
    device_id = db.Column(db.Integer, nullable=False)
    resault = db.Column(db.String(100), nullable=False, server_default=db.FetchedValue())
    testman_name = db.Column(db.String(100), nullable=False, server_default=db.FetchedValue())
    test_status = db.Column(db.String(100), nullable=False, server_default=db.FetchedValue())
    update_time = db.Column(db.DateTime, nullable=False, server_default=db.FetchedValue())
    create_time = db.Column(db.DateTime, nullable=False, server_default=db.FetchedValue())
    device_name = db.Column(db.String(100), nullable=False, server_default=db.FetchedValue())
    model = db.Column(db.String(100), nullable=False, server_default=db.FetchedValue())
    manufacture = db.Column(db.String(100), nullable=False, server_default=db.FetchedValue())
    rank = db.Column(db.String(100), nullable=False, server_default=db.FetchedValue())
    number = db.Column(db.String(100), nullable=False, server_default=db.FetchedValue())
    date = db.Column(db.String(100), nullable=False, server_default=db.FetchedValue())
    reason_back = db.Column(db.String(100), nullable=False, server_default=db.FetchedValue())
    reason_force = db.Column(db.String(100), nullable=False, server_default=db.FetchedValue())

